package com.loklok.code.confuse.model;

import com.loklok.code.confuse.util.CommonUtil;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.List;

/**
 * @Classname ConfigSetting
 * @Description
 * @Date 2023/5/11 16:40
 * @author wangchangjiu
 */
public class CodePathConfig implements Serializable {

    private String codeAuthor;

    private String controllerPath;

    private String voPath;
    private String vmPath;

    private String requestPath;

    private String deepSeekApiKey;

    private String deepSeekPrompt;

    /**
     *  deep seek 提示词文件路径
     */
    private String deepSeekPromptFile;

    /**
     *  代码模板路径
     */
    private String codeTemplate;

    private Integer batch;

    /**
     *  模板不需要收集的类
     */
    private String notCollectClass;


    public String getCodeAuthor() {
        return codeAuthor;
    }

    public void setCodeAuthor(String codeAuthor) {
        this.codeAuthor = codeAuthor;
    }

    public String getControllerPath() {
        return controllerPath;
    }

    public void setControllerPath(String controllerPath) {
        this.controllerPath = controllerPath;
    }

    public String getVoPath() {
        return voPath;
    }

    public void setVoPath(String voPath) {
        this.voPath = voPath;
    }

    public String getVmPath() {
        return vmPath;
    }

    public void setVmPath(String vmPath) {
        this.vmPath = vmPath;
    }

    public String getRequestPath() {
        return requestPath;
    }

    public void setRequestPath(String requestPath) {
        this.requestPath = requestPath;
    }


    public String getDeepSeekApiKey() {
        return deepSeekApiKey;
    }

    public void setDeepSeekApiKey(String deepSeekApiKey) {
        this.deepSeekApiKey = deepSeekApiKey;
    }


    public Integer getBatch() {
        return batch;
    }

    public void setBatch(Integer batch) {
        this.batch = batch;
    }

    public String getDeepSeekPrompt() {
        return deepSeekPrompt;
    }

    public void setDeepSeekPrompt(String deepSeekPrompt) {
        this.deepSeekPrompt = deepSeekPrompt;
    }

    public String getCodeTemplate() {
        return codeTemplate;
    }

    public void setCodeTemplate(String codeTemplate) {
        this.codeTemplate = codeTemplate;
    }

    public String getNotCollectClass() {
        return notCollectClass;
    }

    public void setNotCollectClass(String notCollectClass) {
        this.notCollectClass = notCollectClass;
    }

    public String getDeepSeekPromptFile() {
        return deepSeekPromptFile;
    }

    public void setDeepSeekPromptFile(String deepSeekPromptFile) {
        this.deepSeekPromptFile = deepSeekPromptFile;
    }

    public boolean requiredFieldsEmpty() {
        return StringUtils.isEmpty(this.controllerPath)
                || StringUtils.isEmpty(this.voPath)
                || StringUtils.isEmpty(this.requestPath)
                || StringUtils.isEmpty(this.deepSeekApiKey)
                || StringUtils.isEmpty(this.deepSeekPrompt);
    }

    public String getObtainRelativePath(ClassMetaData item){
        if(item.voType()){
            return this.getVoPath();
        } else if (item.requestType()) {
            return this.getRequestPath();
        } else if (item.controllerType()) {
            return this.getControllerPath();
        }
        return null;
    }
}
